package service.impl;

import domain.User;
import dao.UserDao;
import dao.impl.UserDaoImpl;
import service.UserService;

import java.sql.SQLException;

/**
 * @Author admin
 * @Date 2019/3/4 11:33
 */
public class UserServiceImpl  implements UserService {
    UserDao dao =new UserDaoImpl();
    @Override
    public User login(String username, String password){
        return dao.login(username,password);
    }

    @Override
    public User register(String username, String email, String password) {
        try {
            return dao.register(username,email,password);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
